Skip to main content

All Questions

2votes
1answer
140views

HackerRank - Binary tree to compute the Nth power of natural numbers that sum up to X

I'm trying to solve this challenge on HackerRank. In short, given x and n, I have to determine how many ways I can pick numbers ...
Enlico's user avatar
3votes
1answer
167views

Find the length of a frequency-change cycle (Advent of Code 2018)

I tried to do the second part of the 1. December challenge of Advent of Code in Haskell. I'm fairly new to Haskell but I have plenty of experience in other (procedural) languages. I struggled with the ...
Aaronmacaron's user avatar
3votes
1answer
173views

Programming Contest - Snuke Festival

Problem Statement The season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three ...
fhiyo's user avatar
3votes
2answers
163views

Count numbers whose digits are only increasing or decreasing

The goal is described here: basically, it is to compute the number of numbers below \$10^n\$ such that its digits are either increasing or decreasing (like 112 or 211, but not like 121). The original ...
awllower's user avatar
7votes
5answers
489views

Pizza Hut math problem #1 in Haskell

I'm currently attempting to learn Haskell after a fair history of imperative programming. When I saw the Pizza Hut Pi Day math problems, I thought the first one would be a good candidate for my ...
user avatar
5votes
2answers
2kviews

Speedup for Project Euler 44 - pentagon numbers

I'm trying to solve the problems of Project Euler with Haskell within less than 10s with optimized code (ghc -O2). Unfortunately, I'm struggling to find a correct ...
Stefan's user avatar
5votes
3answers
782views

Phone List challenge

To learn Haskell, I've been going at this challenge, which is to check a list of phone numbers to ensure that no number is a prefix of another. However, my code is way too slow. I am really new to ...
vakio's user avatar
6votes
1answer
253views

Evaluating Fibonacci-sequence-based recurrence relation (SPOJ Flibonakki)

I have a function fib2 which returning two values as Tuple but I want to print the product of tuples returned by function fib2. I am new to Haskell so please ...
Lakshman's user avatar
5votes
1answer
1kviews

Computation for finding the largest prime factor of 600851475143 is slow

I implemented the following for Project 3 in Project Euler: ...
Kevin Meredith's user avatar

close